import 'package:drift/drift.dart';
import 'package:report_sdk/src/database/map_converter.dart';
import 'package:report_sdk/src/models/event.dart';

@UseRowClass(Event)
class Reports extends Table {
  TextColumn get id => text()();
  TextColumn get name => text()(); // 上报的事件名字
  TextColumn get params =>
      text().nullable().map(NullableMapConverter())(); // 上报的数据，存储为 JSON 格式[] 字符串
  DateTimeColumn get timestampMicros => dateTime()();

  @override
  get primaryKey => {id};
}
